module Fighter {
	/**
	 * 飞向固定目标点飞机(防守场景通用敌机) ---刘伟
	 * */
	// export class PlaneToPoint extends PlaneObject {
	// 	public constructor(_plane_type: string, _hp: number, _texture: egret.Texture) {
	// 		super(_plane_type, _hp, _texture);
	// 	}
	// 	/**目标点 */
	// 	protected targetPoint: egret.Point;

	// 	/**飞机进入舞台 */
	// 	protected addToStage() {
	// 		this.targetPoint = PlayerMessage.instance.HomePoint;
	// 		this.x = Math.random() * (640 - this.width);
	// 		this.initializeHp();
	// 		this.addEventListener(egret.Event.ENTER_FRAME, this.flightPath, this);
	// 		this.addEventListener(egret.Event.ENTER_FRAME, this.hitted, this);

	// 	}
	// 	/**飞机离开舞台 */
	// 	protected removeFromStage(evt: egret.Event) {
	// 		egret.Tween.removeTweens(this);
	// 		this.removeEventListener(egret.Event.ENTER_FRAME, this.moveProgress, this);
	// 		this.removeEventListener(egret.Event.ENTER_FRAME, this.flightPath, this);
	// 		this.removeEventListener(egret.Event.ENTER_FRAME, this.hitted, this);
	// 		GamePools.instance.reclaim(this);
	// 	}
	// 	/**飞行方式 */
	// 	protected flightPath() {
	// 		egret.Tween.removeTweens(this);
	// 		if (this.x == this.targetPoint.x && this.y == this.targetPoint.y) {
	// 			return;
	// 		}
	// 		var target = {
	// 			x: this.targetPoint.x - this.x,
	// 			y: this.targetPoint.y - this.y
	// 		};
	// 		var dist = Math.sqrt(Math.pow(target.y, 2) + Math.pow(target.x, 2));

	// 		var deg = Math.atan2(target.y, target.x);

	// 		var deltaY = this.speed * Math.sin(deg);
	// 		var deltaX = this.speed * Math.cos(deg);

	// 		egret.Tween.get(this).to({ x: this.x += deltaX, y: this.y += deltaY }, 5000);
	// 	}
	// 	/**飞机碰撞掉血 */
	// 	protected hitted() {
	// 		for (let i = 0; i < AirBattle.Bulletlist.length; i++) {
	// 			if (GameHit.GameHit(this, AirBattle.Bulletlist[i])) {
	// 				this.Hp-=PlayerMessage.instance.HomeAtk;
	// 				AirBattle.Bulletlist[i].Hp--;
	// 			}
	// 		}
	// 		if (this.y > PlayerMessage.instance.HomePoint.y - 100) {
	// 			this.Hp = 0;
	// 			PlayerMessage.instance.BaseHp--;
	// 		}
	// 		//判断护盾开启
	// 		if (PlayerMessage.instance.HomeShield && this.y > PlayerMessage.instance.HomePoint.y - 200) {
	// 			this.Hp = 0;
	// 		}
	// 	}



	// }
}